package day04;
import java.util.Scanner;
public class CharDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("小游戏：猜数字");
        System.out.println("请输入：");
        int num = (int)(Math.random()*2000+1);
        int a = scan.nextInt();
        while ( a != num ){
            if ( a > num ){
                System.out.println("猜大了！");
                System.out.println("请重新输入：");
            }else {
                System.out.println("猜小了！");
                System.out.println("请重新输入：");
            }
            a = scan.nextInt();
        }
        System.out.println("猜对了！");
        System.out.println("你真是个小机灵鬼");
    }
}
